﻿using System;
using System.Collections.Generic;

namespace TrazandoAndo
{
    public sealed class ThreadInfo
    {
        public readonly Stack<StackInfo> stack =
            new Stack<StackInfo>();

        public readonly int     id                  = 0;
        public readonly string  name                = string.Empty;
        public readonly bool    isBackground        = false;
        public readonly bool    isThreadpoolThread  = false;

        // start tickcount del thread
        public readonly int startTime = 0;

        public ThreadInfo (
            int id,
            string name,
            bool isBackground,
            bool isThreadpoolThread
        )
        {
            this.id                 = id;
            this.name               = name;
            this.isBackground       = isBackground;
            this.isThreadpoolThread = isThreadpoolThread;

            this.startTime          = Environment.TickCount;
        }

        public int stackDepth
        {
            get { return stack.Count; }
        }
    }
}
